﻿//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Mapping Application Block
//===============================================================================

using System;

namespace EntLibContrib.Mapping.QuickStart.DomainObjects
{
	/// <summary>
	/// A basic domain object with no foreign keys to other objects
	/// </summary>
	[Mapper(Name = "Basic1 Mapper")]
	public class Basic1 : OwnerDomainBase
	{
		#region Fields
		private string sampleString;
		private DateTime sampleDate;
		private bool sampleBoolean;
		private int sampleInt;
		private decimal sampleDecimal;
		#endregion

		#region Properties
		[Map()]
		public string SampleString
		{
			get { return sampleString; }
			set
			{
				sampleString = value;
				IsDirty = true;
			}
		}

		[Map()]
		public DateTime SampleDate
		{
			get { return sampleDate; }
			set
			{
				sampleDate = value;
				IsDirty = true;
			}
		}

		[Map()]
		public bool SampleBoolean
		{
			get { return sampleBoolean; }
			set
			{
				sampleBoolean = value;
				IsDirty = true;
			}
		}

		[Map()]
		public int SampleInt
		{
			get { return sampleInt; }
			set
			{
				sampleInt = value;
				IsDirty = true;
			}
		}

		[Map()]
		public decimal SampleDecimal
		{
			get { return sampleDecimal; }
			set
			{
				sampleDecimal = value;
				IsDirty = true;
			}
		}
		#endregion

		#region Construction
		/// <summary>
		/// Initializes a new instance of the <see cref="Basic1"/> class.
		/// </summary>
		public Basic1()
		{ }
		#endregion

		#region Public Methods
		/// <summary>
		/// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
		/// </summary>
		/// <returns>
		/// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
		/// </returns>
		public override string ToString()
		{
			return sampleString;
		}
		#endregion
	}
}
